<template>
    <el-container class="operation-wrapper">
        <div class="ctbox">
            <el-menu
                    router
                    :default-active="$route.path"
                    mode="horizontal" @select="handleSelect">
                <el-menu-item v-for="item in $router.options.routes[4].children" :index="item.path">{{item.name}}</el-menu-item>
                <el-menu-item>
                    <i class="el-icon-user-solid"></i>
                    <span>{{account.nickname}}</span>
                </el-menu-item>
                <el-menu-item>
                    <el-link type="primary" @click="$router.push('/login')">退出登录</el-link>
                </el-menu-item>
            </el-menu>
        </div>
        <el-header height="240px" style="background-color: rgb(104,146,162)">
            <img src="../assets/icd.png" width="100%" height="100%"/>
            <div>
                <div style="color: white;position:absolute; left:38%;top: 15%;
                                font-size: xx-large;font-weight: bold">
                    <div style="margin-left: 30px;">ICD-11疾病分类编码管理平台</div>
                </div>
                <div style="color: white;position:absolute; left:32%; top:25%;
                                font-size: xx-large;font-weight: bold">
                    <router-view @postchildInfo="getChildInfo" name="inputSlot"/>
                </div>
            </div>
        </el-header>
        <el-container>
            <el-main>
                <router-view :searchVal="ICDInfo"></router-view>
            </el-main>
        </el-container>
    </el-container>
</template>

<script>
    export default {
        data() {
            return {
                account:'',
                activeIndex: '1',
                ICDInfo:{

                }
            };
        },
        created() {
            this.account = JSON.parse(window.localStorage.getItem('access-data'));
        },
        methods: {
            getChildInfo(ICDInfo){
                this.ICDInfo=ICDInfo;
            },
            handleSelect(key, keyPath) {
                console.log(key, keyPath);
            }

        }
    }
</script>

<style scoped>
    .ctbox {
        margin: 0 auto;
    }
</style>